/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gap.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Mrs Yun KZ
 */
@Entity
@Table(name = "gap_master_unit_oultet")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "GapMasterUnitOultet.findAll", query = "SELECT g FROM GapMasterUnitOultet g"),
    @NamedQuery(name = "GapMasterUnitOultet.findByUnitOultetId", query = "SELECT g FROM GapMasterUnitOultet g WHERE g.unitOultetId = :unitOultetId"),
    @NamedQuery(name = "GapMasterUnitOultet.findByUnitOultetName", query = "SELECT g FROM GapMasterUnitOultet g WHERE g.unitOultetName = :unitOultetName")})
public class GapMasterUnitOultet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "unit_oultet_id")
    private String unitOultetId;
    @Column(name = "unit_oultet_name")
    private String unitOultetName;
    @JoinColumn(name = "unit_oultet_outlet_id", referencedColumnName = "oultet_id")
    @ManyToOne(optional = false)
    private GapMasterOultet unitOultetOutletId;

    public GapMasterUnitOultet() {
    }

    public GapMasterUnitOultet(String unitOultetId) {
        this.unitOultetId = unitOultetId;
    }

    public String getUnitOultetId() {
        return unitOultetId;
    }

    public void setUnitOultetId(String unitOultetId) {
        this.unitOultetId = unitOultetId;
    }

    public String getUnitOultetName() {
        return unitOultetName;
    }

    public void setUnitOultetName(String unitOultetName) {
        this.unitOultetName = unitOultetName;
    }

    public GapMasterOultet getUnitOultetOutletId() {
        return unitOultetOutletId;
    }

    public void setUnitOultetOutletId(GapMasterOultet unitOultetOutletId) {
        this.unitOultetOutletId = unitOultetOutletId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (unitOultetId != null ? unitOultetId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapMasterUnitOultet)) {
            return false;
        }
        GapMasterUnitOultet other = (GapMasterUnitOultet) object;
        if ((this.unitOultetId == null && other.unitOultetId != null) || (this.unitOultetId != null && !this.unitOultetId.equals(other.unitOultetId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return unitOultetName;
//        return "com.gap.entities.GapMasterUnitOultet[ unitOultetId=" + unitOultetId + " ]";
    }
    
}
